# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=verilator
pkgver=5.028
pkgrel=0
pkgdesc="Convert Verilog and SystemVerilog to C++ or SystemC"
url="https://verilator.org"
arch="x86 x86_64" # limited by systemc
license="LGPL-3.0-only"
depends="perl"
makedepends="autoconf automake python3 systemc-dev flex flex-dev bison lsb-release help2man"
subpackages="$pkgname-dev $pkgname-doc"
source="https://github.com/verilator/verilator/archive/refs/tags/v$pkgver/verilator-$pkgver.tar.gz"

prepare() {
	default_prepare
	autoconf
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
d3d8d107029afbbcdd9f7a06e7fb17de7c74b4334f6eb5316719550ceec64264d6c95fad9e03214a4ae39ce2e8f2c4bb650c755acf35f4cd656fb1b71300070b  verilator-5.028.tar.gz
"
